package com.woniuxy.woniumall.service;


import com.woniuxy.woniumall.entity.Address;
import com.woniuxy.woniumall.entity.User;
import com.woniuxy.woniumall.mapper.AddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServcie {

    @Autowired
    AddressMapper addressMapper ;

    @Autowired
    Address a ;

    public List<Address> findMyAddress(User user) {
        return addressMapper.selectMyAdderss(user.getId());
    }

    public Address add(Address address) {
        addressMapper.insert(address);
        return address ;
    }
}
